Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added typing in lots of io places, added SileSlicer #695

Merged
merged 2 commits into from
Mar 1, 2024
Merged

Conversation

zerothi
Copy link
Owner

@zerothi zerothi commented Mar 1, 2024

Added lots of typehints in the code, primarily in the io code base.

Changed the way the siesta.stdout siles handle data. They now rely on the SileSlicer and thus can be sliced upon calling. It makes the code a little simpler but also highligted some problems.

In particular the problem arise when the return function needs to do different things depending on whether the file is done reading, or not.

The defaults for stdoutSileSiesta has changed to read the next entry in the file. This is in contrast to the way it was. It will require users to adapt!
the reason for this can be found in the discussion in #586.

This streamlines the usage across the different parts of the IO handling.

@pfebrer I would be interested in your view on whether we could adapt these changes to the read_scf method, i.e. slicing would act on MD indices.

  • Closes #x
  • Added tests for new/changed functions?
  • Ran isort . and black . [24.2.0] at top-level
  • Documentation for functionality in docs/
  • Changes documented in CHANGELOG.md

Added lots of typehints in the code, primarily in the
io code base.

Changed the way the siesta.stdout siles handle data.
They now rely on the SileSlicer and thus can be sliced
upon calling. It makes the code a little simpler but also
highligted some problems.

In particular the problem arise when the return function
needs to do different things depending on whether the file
is done reading, or not.

The defaults for stdoutSileSiesta has changed to read
the next entry in the file. This is in contrast to the
way it was. It will require users to adapt!
the reason for this can be found in the discussion in
#586.

This streamlines the usage across the different parts of the
IO handling.

Signed-off-by: Nick Papior <[email protected]>
Copy link

codecov bot commented Mar 1, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 24 lines in your changes are missing coverage. Please review.

Project coverage is 75.65%. Comparing base (fa79f1f) to head (0ba8d68).

Files Patch % Lines
src/sisl/io/siesta/stdout.py 89.09% 12 Missing ⚠️
src/sisl/io/xsf.py 65.38% 9 Missing ⚠️
src/sisl/_core/tests/test_lattice.py 0.00% 1 Missing ⚠️
src/sisl/io/_multiple.py 93.75% 1 Missing ⚠️
src/sisl/io/tests/test_object.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #695      +/-   ##
==========================================
- Coverage   75.68%   75.65%   -0.04%     
==========================================
  Files         398      398              
  Lines       50429    50420       -9     
==========================================
- Hits        38169    38146      -23     
- Misses      12260    12274      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pfebrer
Copy link
Contributor

pfebrer commented Mar 1, 2024

@pfebrer I would be interested in your view on whether we could adapt these changes to the read_scf method, i.e. slicing would act on MD indices.

I think it makes sense, but I won't be able to work on it for a long time. Next week I'm at a conference and then I go on a one month holiday 😅 Also on some other thread I think I commented that there could be two slicers in this case: one for MD step and one for scf step. I don't remember what was the conclusion.

And implemented this for read_scf.
Now there is a slicer for MD steps in the read_scf
cycle.

Signed-off-by: Nick Papior <[email protected]>
@zerothi zerothi merged commit 83d4f49 into main Mar 1, 2024
8 checks passed
@zerothi zerothi deleted the typing-slicing branch March 1, 2024 21:06
@zerothi
Copy link
Owner Author

zerothi commented Mar 1, 2024

@pfebrer no need, I just did it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants